package com.fy.fyspace.model.enums.picture;

import lombok.Getter;

/**
 * 图片删除状态枚举
 */
@Getter
public enum PictureDeleteStatusEnum {

    NOT_DELETE(0, "未删除"),
    IS_DELETE(1, "已删除");

    /**
     * 状态值
     */
    private final Integer value;

    /**
     * 状态描述
     */
    private final String text;

    PictureDeleteStatusEnum(Integer value, String text) {
        this.value = value;
        this.text = text;
    }

    /**
     * 根据 value 获取枚举值
     *
     * @param value 状态值
     * @return 对应的枚举值
     */
    public static PictureDeleteStatusEnum getEnumByValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (PictureDeleteStatusEnum anEnum : PictureDeleteStatusEnum.values()) {
            if (anEnum.value.equals(value)) {
                return anEnum;
            }
        }
        return null;
    }
}